UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2JdEcbhhPkjXfJ7MObMigRGCNzWjZIVw/FRnmiHwn94=' 
WHERE 
  key_id = '6260c2f2e01b21230c6cc38b098a929b27b16144403f05fc1c432cad666fbbff' 
  AND (
    token = '2JdEcbhhPkjXfJ7MObMigRGCNzWjZIVw/FRnmiHwn94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022