UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xS/n9qrTTRjTm+PHJtZQGyIFMRLPNu5KbaLcONtcvsw=' 
WHERE 
  key_id = '70806267848a8f805a7a36381dddc08ccce2d56d898e3ccfb90b2e519ead4dcf' 
  AND (
    token = 'xS/n9qrTTRjTm+PHJtZQGyIFMRLPNu5KbaLcONtcvsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028