UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yK0igKrqa6LoqjTszWVSWRMqC1SW+jMaUa++e9AaHi0='
WHERE
key_id = 'b3f3c66bf9b0e19e9d9b58a4126c935e342aaea988ce9804956cff7969c7062f'
AND (
token = 'yK0igKrqa6LoqjTszWVSWRMqC1SW+jMaUa++e9AaHi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)