UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q8MS7nYer7y8yW83GcrFSL54Vd5+wl7qLyNU8DImkw0='
WHERE
key_id = '32269fa94e2c653d91ddadfea852d0693f27ee12066d71db66c82a70292d19a4'
AND (
token = 'q8MS7nYer7y8yW83GcrFSL54Vd5+wl7qLyNU8DImkw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)