UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7qSGmtXQQ2U/+PZOwtC7U6n0+fKrdIlPDUpN0xc1te4='
WHERE
key_id = 'e64c495fae7196fba0b15fd7b6c70ffc2912795a6507fe7bd94369a80f46fd06'
AND (
token = '7qSGmtXQQ2U/+PZOwtC7U6n0+fKrdIlPDUpN0xc1te4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)