UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aeC7GU+vYkhb6+PX/t4OkcBs/BbY+VWR/6ERjz/dbu0='
WHERE
key_id = '475cc0a329e1020b6762f1faf3a97e6a27aafa606c0ad11380c195c7bb7d50c0'
AND (
token = 'aeC7GU+vYkhb6+PX/t4OkcBs/BbY+VWR/6ERjz/dbu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)