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