UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MR/0OdWVjkWByZY9vFEyWatIGo8wzqwb316q4s3owkI=' 
WHERE 
  key_id = '1e9a19e04b934293240aab4e94572ae1dfc8886948b97fe391d4c771c6f9361c' 
  AND (
    token = 'MR/0OdWVjkWByZY9vFEyWatIGo8wzqwb316q4s3owkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020