UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FLP77eADHsV2GWmIHNGStSRQvGXn2L8MnmvtoxTWb6w='
WHERE
key_id = '365cf0da3695fb061c7165e48351672201baa1ac1ef632428ad1f39533ad738d'
AND (
token = 'FLP77eADHsV2GWmIHNGStSRQvGXn2L8MnmvtoxTWb6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)