UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kQ0vslvxwrgk2K8aIL+6wOLPCSrafG4buHUTZuI/Eo8='
WHERE
key_id = '876d73a0c1b8bcc946550712f05b49e3f51485e16f0eabc9059680070efd3903'
AND (
token = 'kQ0vslvxwrgk2K8aIL+6wOLPCSrafG4buHUTZuI/Eo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)