UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M3Exe95/+sbZ9RL8PU4ajzQROXsd0Puw9meL8jDtIL4='
WHERE
key_id = 'ad527738f33859a92aea5fa27ce4f2ac79c87e27ebc86b38aedcd148f1ed2adc'
AND (
token = 'M3Exe95/+sbZ9RL8PU4ajzQROXsd0Puw9meL8jDtIL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)