UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8hUlesYAR8ic/wbnzQF9MNg2Bcbcc5X8bVuep7OLVXM='
WHERE
key_id = '4238e87f907245b925b6e442f666e72adc196eba5aa7b75b1dd41d388dff7892'
AND (
token = '8hUlesYAR8ic/wbnzQF9MNg2Bcbcc5X8bVuep7OLVXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)