UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+cNyaCkLvJNcISe+cmpmppmFFEjMNjxbMINlzIF6bFA='
WHERE
key_id = '33434e5fb9bbc2f31e589eb525c54a832c3d51ce25b3ca6bb5991d01a1e9acc4'
AND (
token = '+cNyaCkLvJNcISe+cmpmppmFFEjMNjxbMINlzIF6bFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)