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