UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lnb94wXxTwoH2C4a2Lq29MLJun9BYdjmt3oN97r6YxQ='
WHERE
key_id = '39248ab6be45269f2c5ce8ed5bde5e245953e70877c9e63a44ce10ad466027f2'
AND (
token = 'Lnb94wXxTwoH2C4a2Lq29MLJun9BYdjmt3oN97r6YxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)