UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x4B48dlA/oCR+clSl+VRIGq0ACQOY+Rtt0rlWvS33eU='
WHERE
key_id = 'e9a8f46a775f5a70a573eb990592a5d6186f1cdf10e46ef644d446a46d03f7d3'
AND (
token = 'x4B48dlA/oCR+clSl+VRIGq0ACQOY+Rtt0rlWvS33eU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)