UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BzMEEkLhV26o+OYyBDwpo0Cb5gtTbit3YutsXDhc5CI='
WHERE
key_id = 'd7a44324b47447b55a0d55672d735f4171bbcd54a3dfbf39840ec6adc1a269d8'
AND (
token = 'BzMEEkLhV26o+OYyBDwpo0Cb5gtTbit3YutsXDhc5CI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)