UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ve4KroeZOVP2AAKEyevHLiYHBNo674hTnVp3Tkj/Us='
WHERE
key_id = '299ec57bb1cc97fa5437c8973c2f1d0cd40032b70b9ae109ede54e8f6250ec97'
AND (
token = '7ve4KroeZOVP2AAKEyevHLiYHBNo674hTnVp3Tkj/Us='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)