UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ls2sRdYn8RXgae+sE5i683o08B797JO12YsPOQGRJFE='
WHERE
key_id = '5079d7e4adc5b0dc3e1fe820f3df03c6356d2d76e202e5d540fa457c280733dc'
AND (
token = 'Ls2sRdYn8RXgae+sE5i683o08B797JO12YsPOQGRJFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)