UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VWIIJIwUVPZ5BODm/Fa/gbQXk+JRftAMF0LO98vzAxU='
WHERE
key_id = 'b5a057c4151ea3cb6b5b3cfad66a22f38e64212f5f98d5f5bd3c0b9e6206a288'
AND (
token = 'VWIIJIwUVPZ5BODm/Fa/gbQXk+JRftAMF0LO98vzAxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)