UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/5fQEfALLxORqrjJvIRDIzV7C5+hcamU8ymHQd5eQbc=' 
WHERE 
  key_id = 'fce835b3e25e0c9e69ab51b5127a699ed8cfeaaab35efeabbb2829b3ebdaafab' 
  AND (
    token = '/5fQEfALLxORqrjJvIRDIzV7C5+hcamU8ymHQd5eQbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042