UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V7bpgbwLfwdfM5VZOvX7h6yJmitDK9ZY7WrLrN5CZ+E='
WHERE
key_id = '00f051e454ffae26cbd7592c2542f824be77e03d168b2796aec4c1d32d75e79a'
AND (
token = 'V7bpgbwLfwdfM5VZOvX7h6yJmitDK9ZY7WrLrN5CZ+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)