UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o0Qnim5mXgQSQZr/cOfQP80a2oMx/szUeZXxQ41Bvzc=' 
WHERE 
  key_id = 'ab79ea1e4e4d834ed6098ddf817e520d0fc863dc0d08b96593379de2c7b4dc6d' 
  AND (
    token = 'o0Qnim5mXgQSQZr/cOfQP80a2oMx/szUeZXxQ41Bvzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026