UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bS06KosG3L33WzlDtvQfgv44BUiP5tFN9NJ4WVjWC4Y='
WHERE
key_id = '32b956fbe09b8a4fb69a846a66807d62963aab8f6c3d235a3a10472d2b3369dd'
AND (
token = 'bS06KosG3L33WzlDtvQfgv44BUiP5tFN9NJ4WVjWC4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)