UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FoR5181Wb0s59wdglRw0cCH+mC8fqFdLc3QtQSFODhE=' 
WHERE 
  key_id = '6b05cadc4fa1b10c956cb7874691a3118a2e552795e951e69260c44313b726ba' 
  AND (
    token = 'FoR5181Wb0s59wdglRw0cCH+mC8fqFdLc3QtQSFODhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016