UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U6qgriMQHTonSHUzJuCqnhYM5BkGQHCUJxAtUg8xWo8='
WHERE
key_id = '98ef34146658014ddc396b0070865145f3070838b079be22df03025be8d402f7'
AND (
token = 'U6qgriMQHTonSHUzJuCqnhYM5BkGQHCUJxAtUg8xWo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)