UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sR6TsE5PzkANtXa7aFNlIxwOG0EXIreQvmMMSAmQK2M='
WHERE
key_id = '64d79794f0c583a4d8be096bedff7b29edc8469cb6b8aa9d1777cf74b6f536d7'
AND (
token = 'sR6TsE5PzkANtXa7aFNlIxwOG0EXIreQvmMMSAmQK2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)