UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JeObhzPusHRMrj2jTkH25ZS4a5nDwtxnmCy3qlXUJ5c=' 
WHERE 
  key_id = '21888668e6e94a1c76bb51b94d92e48592aea0be6459823a8af1429bfbcc3b97' 
  AND (
    token = 'JeObhzPusHRMrj2jTkH25ZS4a5nDwtxnmCy3qlXUJ5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053