UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ccGS0ows7llOtQMshjDIHCLZUZYXzqgcA2jFXpVEA2E='
WHERE
key_id = '9ba53494907cecc463c9ccafec6499a59ce3ebaf9d99b8a2cf2aed6d64c77655'
AND (
token = 'ccGS0ows7llOtQMshjDIHCLZUZYXzqgcA2jFXpVEA2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)