UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WCvLO228VJSAe6bMaTTwHQltwcWmj86xmflGIU2qPD4='
WHERE
key_id = 'eef69f2659112cf011969c573ceb3702e0d167d36ae4f6fd2c6e9768ceb6a979'
AND (
token = 'WCvLO228VJSAe6bMaTTwHQltwcWmj86xmflGIU2qPD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)