UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MX2TgaQQ34okorAtjBKD5MIAwZWnrZwdTNq6yXfQelc='
WHERE
key_id = '8f375b3f15f0c909a9ab3242df18d00643152cbd4924d948c137e40ead6310a2'
AND (
token = 'MX2TgaQQ34okorAtjBKD5MIAwZWnrZwdTNq6yXfQelc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)