UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HeB2Q6ck6mIp24E2JoLnJRs2ZhtSEeSk7rypLpcI3/Q=' 
WHERE 
  key_id = 'fd7f6cfbb02a260e1d1c5f818b9a9b3ce753910d1bcc5e59b04327adbf210a87' 
  AND (
    token = 'HeB2Q6ck6mIp24E2JoLnJRs2ZhtSEeSk7rypLpcI3/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028