UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qq4i+MfsVDzZ/7KE5XC+JU27Bj0SMsKXYkpjXlum12E='
WHERE
key_id = 'f19f33bf2239f6a4d2be953a110a1f6c9c10b0afe2a6a04f1cec500145b93954'
AND (
token = 'qq4i+MfsVDzZ/7KE5XC+JU27Bj0SMsKXYkpjXlum12E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)