UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ju4YfbDLP9O4unO91TTEbSZw1UjvUhO97/RmYNpg/q4='
WHERE
key_id = 'cbe4549cf93c664382436b74d163a1d751953b362ca9dc28ff7ea9d7e507b3cb'
AND (
token = 'Ju4YfbDLP9O4unO91TTEbSZw1UjvUhO97/RmYNpg/q4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)