UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UNCGSGyZ9M87vuFgua5TX3OnW3aL0V3tyPRnYEeXiT0='
WHERE
key_id = 'c43f357760859dd4d08b5eaf7af8f626719f601c88b440997e26258c9c9d2762'
AND (
token = 'UNCGSGyZ9M87vuFgua5TX3OnW3aL0V3tyPRnYEeXiT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)