UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UENKU37TogvZ3D6uqyuCQlRs4ifO2jsUQWR/4BhqX08='
WHERE
key_id = '819bf5deba2c3f0ffff60a3998787b788dd6f38fd758cfb701dd688a69919aff'
AND (
token = 'UENKU37TogvZ3D6uqyuCQlRs4ifO2jsUQWR/4BhqX08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)