UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wKn43Mx6c/jZ6IB4yLeMETj30+7rTLaYmFOG9saLd1A='
WHERE
key_id = 'f1a5c0cf48b5b67374f807a272c9b08424cbf1a72fc71cd76ffab4f05250c60f'
AND (
token = 'wKn43Mx6c/jZ6IB4yLeMETj30+7rTLaYmFOG9saLd1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)