UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/iK8gkaZJ8ix1IL7NskOgkjq+hpaCtx8J61NO6Surd0='
WHERE
key_id = '740b8075341c2526a68999796e236a3809919a4bf19bef6548e0b7c0cba295c1'
AND (
token = '/iK8gkaZJ8ix1IL7NskOgkjq+hpaCtx8J61NO6Surd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)