UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lsSFPyZRfZEvOKyF7xFebrwMJ1aphL+7FVIhUp7UiFE=' 
WHERE 
  key_id = '7f00a2a6fe673f2cb0c82ab798859163e27d30b20fb3f0e202173800958aeac5' 
  AND (
    token = 'lsSFPyZRfZEvOKyF7xFebrwMJ1aphL+7FVIhUp7UiFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054