UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnAueqfVAKoZkId+yUH7JGzj6mo9sWndjqNuMkJR/Mw='
WHERE
key_id = '1e47c117507af182d97c2efb4ee267997f728031a5b8ad6c3c9930eaf7246a0e'
AND (
token = 'HnAueqfVAKoZkId+yUH7JGzj6mo9sWndjqNuMkJR/Mw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)