UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AKsiBWhv+8YYkyd/4mXynUMxb6IQIT541U4tRa0qwuQ='
WHERE
key_id = '9d78ff02b6c3f42530de65d14ade66314414dc1f937ea80c9c6b540dd2eaef05'
AND (
token = 'AKsiBWhv+8YYkyd/4mXynUMxb6IQIT541U4tRa0qwuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)