UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uwvZqLgNNkw4ZA6e9Mq6CTOnpZ2SLxeIWbB661V0OYg='
WHERE
key_id = 'eae2c61b12f1875b88116fa30ee03fdbc94ccd0bfb7e3d573f7c1b70253a9559'
AND (
token = 'uwvZqLgNNkw4ZA6e9Mq6CTOnpZ2SLxeIWbB661V0OYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)