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