UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QaCOGTGYMBWLSIIVqJ4e6PaFrYtaMTFGcrUgq/MV9AU='
WHERE
key_id = 'c8ee7467e43e9659c73b9ff0b023ad0529adef5dca82098569fa6f47fce2fe7c'
AND (
token = 'QaCOGTGYMBWLSIIVqJ4e6PaFrYtaMTFGcrUgq/MV9AU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)