UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k69gTfAQnBei4oLwgUQPWkmOd0wTf82dmsDkostlUgQ='
WHERE
key_id = '2dd757a4fe89e59bbb50073f94a70a58c998106331536a7d2ee8c9fbf6a048c2'
AND (
token = 'k69gTfAQnBei4oLwgUQPWkmOd0wTf82dmsDkostlUgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)