UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1sLE8SJ89Q8Xa4NNYmwfPmSQ0PDOQv714oxGyz9rwSU='
WHERE
key_id = '2ac4a0b4e0ad3864792b1a38a9ed47bd0127ff5b4c2310835cb63ee591bdfc34'
AND (
token = '1sLE8SJ89Q8Xa4NNYmwfPmSQ0PDOQv714oxGyz9rwSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)