UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ef+z/WULt+wk++ZIr44cA6RD0vFTMzeTOJmSWjpIK00=' 
WHERE 
  key_id = 'ed9727169a0462d1ded92ef6b6ded33305bc38749b5d2e78c8051a528c8b6b36' 
  AND (
    token = 'Ef+z/WULt+wk++ZIr44cA6RD0vFTMzeTOJmSWjpIK00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029