UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gx1la45XqSk6i89n2Kd/GYviL5NyfH2Gv9A2/RsqSA4='
WHERE
key_id = '7e821f1db2f3f16e1b0de0ae4700fb1644bb6db5bc39dcbdd3a0cc2c0377ca8d'
AND (
token = 'gx1la45XqSk6i89n2Kd/GYviL5NyfH2Gv9A2/RsqSA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)