UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cpdert6DUoNvEsTdWYtTzdxKL8bt/wjXStcgf331VHw='
WHERE
key_id = '8a6e724e3a0bbcc14d19e81de41abd02ee2f2e935d3ef2abf4ac794bf99b9fd9'
AND (
token = 'Cpdert6DUoNvEsTdWYtTzdxKL8bt/wjXStcgf331VHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)